/**
 * Created by coder on 2018/6/5.
 */

//用来获取URL中的参数,search 为url或者url ?后的参数，name为参数名
function getQueryString(search,name) {
	const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	const r = search.substr(1).match(reg);
	if (r != null) return unescape(r[2]);
	return null;
}

export default getQueryString;